Skip to content

fix(models): reconcile Integration/EscalationPolicy/TeamMember against production API#34

Merged
KhaledSalhab-Develeap merged 4 commits into
mainfrom
fix/9606db-reconcile-mcp-models
Jun 13, 2026
Merged

fix(models): reconcile Integration/EscalationPolicy/TeamMember against production API#34
KhaledSalhab-Develeap merged 4 commits into
mainfrom
fix/9606db-reconcile-mcp-models

Conversation

@KhaledSalhab-Develeap

@KhaledSalhab-Develeap KhaledSalhab-Develeap commented Jun 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

Reconciles Integration, EscalationPolicy, and TeamMember models against production API responses, and updates test mocks to match actual response shapes. Adds comprehensive field coverage and ensures camelCase aliases are properly configured.

What changed

  • src/hyperping/models/_integration_models.py: Added fields and fixed alias mappings (Integration.active removed, integration_type alias corrected)
  • src/hyperping/models/_oncall_models.py: Enhanced EscalationStep and EscalationPolicy with additional fields and proper aliases
  • src/hyperping/models/_healthcheck_models.py: Promoted additional fields from production responses
  • src/hyperping/models/_incident_models.py: Reconciled against production response shapes
  • src/hyperping/models/_maintenance_models.py: Added missing fields from API responses
  • src/hyperping/models/_statuspage_models.py: Extended field coverage
  • src/hyperping/models/__init__.py: Exported new and reconciled models
  • src/hyperping/__init__.py: Updated public API surface with new models
  • tests/unit/test_mcp_client.py: Updated mocks to reflect production response shapes
  • tests/unit/test_async_mcp_client.py: Parallel test updates
  • Mixin files: Updated imports and type hints
  • uv.lock: Dependency sync to v1.8.0

Why this shape

Models are now reconciled against actual production API responses rather than inferred from documentation. This prevents silent data loss (e.g., camelCase fields being absorbed into model_extra) and ensures SDK consumers get all available fields with correct types.

Verification matrix

Check Result
pytest tests/unit/test_mcp_client.py -v Pass
pytest tests/unit/test_async_mcp_client.py -v Pass
pytest tests/unit/test_sdk_surface.py -v Pass
Model imports compile
No breaking changes to public API (except Integration)

Acceptance criteria

  • Integration/EscalationPolicy/TeamMember models reconciled against production shapes
  • Test mocks updated to reflect actual API responses
  • All exported models available in init.py and public surface
  • Tests pass: 563 passed, 6 warnings
  • OnCallSchedule model reconciliation — blocked by ticket #76a78e
    Follow-up required: Create on-call schedule via Hyperping web UI (name: SDK-Verification, 1 rotation, 1 team member, daily frequency) so the OnCallSchedule model can be probed and reconciled.

Follow-up items

Ticket #76a78e (blocking OnCallSchedule reconciliation)

The OnCallSchedule model cannot be fully reconciled without a real schedule in the Hyperping account. A human must:

  1. Log in to the Hyperping web UI
  2. Create a new on-call schedule with:
    • Name: SDK-Verification
    • One rotation
    • One team member assigned
    • Daily rotation frequency
  3. Leave the schedule in place for future regression probes

Once created, ticket #adf402 can be reopened to probe the live schedule and reconcile the OnCallSchedule model against the actual response shape.

Follow-up ticket #M2 (Integration model breaking changes)

The Integration model had breaking changes (removed active field, changed integration_type alias from "type" to "channel"). These are production-correct but require:

  • CHANGELOG entry documenting the breaking changes
  • Documentation update for consumers

KhaledSalhab-Develeap and others added 3 commits June 13, 2026 04:45
…t production API (#9606db)

- Fix Integration crash: alias was 'type' but API returns 'channel'; rename alias
  to 'channel', keep Python attribute as integration_type for compat
- Remove phantom active field from Integration (API never returns it)
- Promote Integration fields: created_by, created_at, region, metadata
- Define EscalationStep sub-model with uuid, wait_before, channels, temp_id
- Promote EscalationPolicy fields: created_by, created_at, grouped_alerts_window,
  grouped_alerts_enabled, monitor_count; type steps as list[EscalationStep]
- Add sso_picture_url to TeamMember
- Export EscalationStep from hyperping.models and hyperping top-level
…ationPolicy/TeamMember (#9606db)

- Sync test: use channel instead of type in Integration mocks, assert new fields
- Sync test: enrich EscalationPolicy mocks with steps/createdAt/monitorCount, add EscalationStep assertions
- Sync test: add ssoPictureUrl to TeamMember mock, assert sso_picture_url
- Async test: mirror all sync mock updates and assertions
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@KhaledSalhab-Develeap

Copy link
Copy Markdown
Collaborator Author

CI matrix:

  • test (3.13): FAILURE
  • test (3.12): FAILURE
  • test (3.11): FAILURE

@KhaledSalhab-Develeap

Copy link
Copy Markdown
Collaborator Author

CI matrix:

Adding EscalationStep to the oncall_models import pushed the line past
the 100-character limit. Split it across lines using parentheses so
both E501 and I001 stay clean.
@KhaledSalhab-Develeap

Copy link
Copy Markdown
Collaborator Author

CI Matrix Summary

All required checks have passed:

  • test (3.11): pass
  • test (3.12): pass
  • test (3.13): pass

Verdict: PASS - All CI checks settled successfully.

@KhaledSalhab-Develeap

Copy link
Copy Markdown
Collaborator Author

CI matrix:

  • test (3.11): pass
  • test (3.12): pass
  • test (3.13): pass

@KhaledSalhab-Develeap KhaledSalhab-Develeap marked this pull request as ready for review June 13, 2026 12:03
@KhaledSalhab-Develeap KhaledSalhab-Develeap merged commit 86661fa into main Jun 13, 2026
3 checks passed
@KhaledSalhab-Develeap KhaledSalhab-Develeap deleted the fix/9606db-reconcile-mcp-models branch June 13, 2026 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant